package edu.xidian.bdilab.jrbigdata.controller.bank;

import edu.xidian.bdilab.jrbigdata.controller.response.ResponseResult;
import edu.xidian.bdilab.jrbigdata.service.bank.login.CheckInfoById;
import edu.xidian.bdilab.jrbigdata.service.bank.login.bankuserloginservice;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName BankLoginController
 * @Description TODO
 * @Author tuantuan
 * @Date 2019/3/20 下午8:43
 * @Version 1.0
 * @Attention Copyright (C), 2004-2019, BDILab, XiDian University
 **/
@RestController
@Api(tags = {"bankLogin-银行用户登录功能"})
public class BankLoginController {

    @Autowired
    public bankuserloginservice bankuserloginservice;
    @Autowired
    CheckInfoById checkInfoById;
    @RequestMapping(value = "bank/login", method = RequestMethod.POST)

    public ResponseResult enterprise_login(@RequestParam String name, @RequestParam String password) {

        ResponseResult responseResult= bankuserloginservice.responsResult(name,password);
        return responseResult;

    }

    @PostMapping("bank/login/{userName}")
    public ResponseResult checkBankInfo(@PathVariable String userName){
        ResponseResult responseResult = new ResponseResult(true, " ", "查询成功");
        responseResult.setData(checkInfoById.checkInfoByUserName(userName));
        return responseResult;
    }
}
